<?php use_stylesheet('tasks.css') ?>
<?php use_javascript('toggle.js') ?>
<!--h1>Tasks List</h1-->
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="/images/mainpage-sliced_16.jpg">
  <tr>
    <td width="20" height="40">&nbsp;</td>
    <td class="style5" style="border-right:solid 1px #FFFFFF;">View Tasks {<?php echo $sf_user->getAttribute('selectedProject')?>}</td>
  </tr>
</table>
<form action="<?php echo url_for('task/search') ?>" method="post"  id="<?php echo $filter->getName() ?>">
<table>
    <tfoot>
      <tr>
        <td colspan="2">        
          <input type="submit" value="Search" />
        </td>
      </tr>
    </tfoot>
    <tbody align="left">
      <?php echo $filter ?>
    </tbody>
  </table>

</form>
<hr/>
<?php include_partial('task/list', array('tasks' => $pager->getResults())) ?>
<?php if ($pager->haveToPaginate()): ?>
  <div class="pagination">
    <a href="<?php echo url_for('task/search') ?>?page=1">
      <img src="/images/first.png" alt="First page" title="First page" border="0" />
    </a>
 
    <a href="<?php echo url_for('task/search') ?>?page=<?php echo $pager->getPreviousPage() ?>">
      <img src="/images/previous.png" alt="Previous page" title="Previous page" border="0" />
    </a>
 
    <?php foreach ($pager->getLinks() as $page): ?>
      <?php if ($page == $pager->getPage()): ?>
        <?php echo $page ?>
      <?php else: ?>
        <a href="<?php echo url_for('task/search') ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
      <?php endif; ?>
    <?php endforeach; ?>
 
    <a href="<?php echo url_for('task/search') ?>?page=<?php echo $pager->getNextPage() ?>">
      <img src="/images/next.png" alt="Next page" title="Next page" border="0" />
    </a>
 
    <a href="<?php echo url_for('task/search') ?>?page=<?php echo $pager->getLastPage() ?>">
      <img src="/images/last.png" alt="Last page" title="Last page" border="0" />
    </a>
  </div>
  <?php endif; ?>
 
  <div class="pagination_desc">
    <strong><?php echo count($pager) ?></strong> tasks in this search
 
    <?php if ($pager->haveToPaginate()): ?>
      - page <strong><?php echo $pager->getPage() ?>/<?php echo $pager->getLastPage() ?></strong>
    <?php endif; ?>
  </div>